package org.projects.graduates.domain;

import javax.persistence.Entity;
import javax.persistence.Table;

import org.apache.commons.lang3.builder.HashCodeBuilder;

import com.dayatang.domain.AbstractEntity;

/**
 * 
 * @author Administrator
 * 
 */
@Entity
@Table(name = "courses")
public class Course extends AbstractEntity {

	private static final long serialVersionUID = -7984770532590404814L;

	private String name;

	private boolean enable;

	private String description;

	private String tag;

	@Override
	public boolean equals(Object other) {
		if (other != null && other instanceof Course) {
			return ((Course) other).equals(this.getId());
		}
		return false;
	}

	public int hashCode() {
		return new HashCodeBuilder(17, 37).append(this.getId()).toHashCode();
	}

	public String toString() {
		return getName() + " " + getDescription();
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getTag() {
		return tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

}
